/*********************************************************************************
 *FileName:  nsuc16xx_pwr.c
 *Version:  V1.0
 *Date: 2023-04-07
 ****************************************Includes***********************************/
#include "nsuc16xx_pwr.h"

/***************************************Variables***********************************/

/***************************************Functions***********************************/
void ChargePump_Init(ChargePum_InitTypeDef *ChargePum_InitStruct)
{
    if (ChargePum_InitStruct->ChargePum_Interrupt != DISABLE)
    {
        SYSCTRL->HCR_b.CIE = 1;
    }
    else
    {
        SYSCTRL->HCR_b.CIE = 0;
    }

    if (ChargePum_InitStruct->ChargePum_Filter != DISABLE)
    {
        SYSCTRL->HCR_b.CFE = 1;
    }
    else
    {
        SYSCTRL->HCR_b.CFE = 0;
    }
    SYSCTRL->HCR_b.CF = (ChargePum_InitStruct->ChargePum_FilterTime & 0x03);

    if (ChargePum_InitStruct->ChargePum_OVShuntDown != DISABLE)
    {
        SYSCTRL->HCR_b.CAE = 1;
    }
    else
    {
        SYSCTRL->HCR_b.CAE = 0;
    }
}

void ChargePump_Cmd(FunctionalState NewState)
{
    if (NewState != DISABLE)
    {
        SYSCTRL->HCR_b.CE = 1;
    }
    else
    {
        SYSCTRL->HCR_b.CE = 0;
    }
}

/***************************************END OF FILE*********************************/
